package com.qingjiang.projectschedule.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qingjiang.projectschedule.pojo.NodeOperation;
import com.qingjiang.projectschedule.pojo.ProjectAllInformation;
import com.qingjiang.projectschedule.pojo.ProjectSchedule;
import org.apache.poi.ss.usermodel.Row;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author jx
 * @description 针对表【project_schedule(项目进度表)】的数据库操作Service
 * @createDate 2024-03-13 20:05:11
 */
public interface ProjectScheduleService extends IService<ProjectSchedule> {

    boolean addOne(ProjectAllInformation projectAllInformation);

    boolean updateProject(ProjectAllInformation projectAllInformation);

    boolean reportProject(ProjectAllInformation projectAllInformation);

    int uploadExcel(Row row, String projectId, int curNode);

    int checkScheduleTime(Row row);

    List<ProjectSchedule> queryProject(String projectId);

    String nodeFinish(NodeOperation nodeOperation);


    boolean setDelayReason(NodeOperation nodeOperation);

    void updateDelayToTimeById(String projectId, Integer nodeId, Date delayTotime);

    ProjectSchedule getNodeEndTime(String projectId, Integer nodeId);

    Date getNodeActualEndTime(String projectId, Integer nodeId);

    List<Map<String, Object>> getNodeByColor(String projectId, String projectName, String color);

    List<Map<String,Object>> getNodeByNodeIds(String projectId,String nodes);

    boolean setNodeState(String projectId, Integer nodeId, Integer nodeState);

    ProjectSchedule getCurNode(String projectId, Integer nodeId);

    int CalNodeStatus(Date planEndTime, Date actualEndTime);

    String getDelayReason(String projectId,Integer nodeId);

    //List<Map<String, Object>> getAllNodesByProjectIds(List<Object> projectIds);

    List<Map<String, Object>> getNodesByCond(String projectId, int lastNode, int curNodeId);

    ProjectSchedule selectByProjectIdAndNodeId(String projectId, String nodeId);

    void updateByProjectIdAndNodeId(ProjectSchedule projectSchedule);
}
